FaceDetectionModel

class FaceDetectionModel(internalModel: OnnxInferenceModel, modelKindDescription: String?) : FaceDetectionModelBase<BufferedImage> , InferenceModel

Face detection model implementation.

See also

Constructors

FaceDetectionModel
Link copied to clipboard
fun FaceDetectionModel(internalModel: OnnxInferenceModel, modelKindDescription: String? = null)

Functions

close
Link copied to clipboard
open override fun close()
convert
Link copied to clipboard
open override fun convert(output: OrtSession.Result): List<DetectedObject>

Converts raw model output to the result.

copy
Link copied to clipboard
open override fun copy(copiedModelName: String?, saveOptimizerState: Boolean, copyWeights: Boolean): InferenceModel
detectFaces
Link copied to clipboard
fun detectFaces(image: BufferedImage, topK: Int = 5, iouThreshold: Float = 0.5f): List<DetectedObject>

Detects topK faces on the given image. If topK is negative all detected faces are returned.

initializeWith
Link copied to clipboard
open override fun initializeWith(vararg executionProviders: ExecutionProvider)

Initialize the model with the specified executions providers.

predict
Link copied to clipboard
open override fun predict(inputData: FloatArray): Int
open fun predict(input: BufferedImage): List<DetectedObject>

Makes prediction on the given input.

predictSoftly
Link copied to clipboard
open override fun predictSoftly(inputData: FloatArray, predictionTensorName: String): FloatArray
reshape
Link copied to clipboard
open override fun reshape(vararg dims: Long)
summary
Link copied to clipboard
open override fun summary(): ModelSummary

Properties

inputDimensions
Link copied to clipboard
open override val inputDimensions: LongArray
internalModel
Link copied to clipboard
open override val internalModel: OnnxInferenceModel

Model used to make predictions.

modelKindDescription
Link copied to clipboard
open override val modelKindDescription: String?

High-level description of the model. Used for model summary printing. For the model hub models it equals to the string representation of the OnnxModelType

preprocessing
Link copied to clipboard
open override val preprocessing: Operation<BufferedImage, Pair<FloatArray, TensorShape>>

Preprocessing operation specific to this model.